import { Component, OnInit, Input } from '@angular/core';
import { AppGlobalService } from './../../shared/service/app-global.service';
@Component({
  selector: 'app-to-app',
  templateUrl: './to-app.component.html',
  styleUrls: ['./to-app.component.scss'],
})
export class ToAppComponent implements OnInit {
  appStoreUrl = 'https://www.pgyer.com/KAID';
  @Input() tagData: any;
  cssStr: any = {};
  constructor(private appGlobalService: AppGlobalService) { }

  ngOnInit() {

    const cssStyles = this.tagData.data.cssStyle.split(",");
    // tslint:disable-next-line:prefer-for-of
    for (let i = 0; i < cssStyles.length; i++) {
      const cssStrs = cssStyles[i].split(":");
      this.cssStr[cssStrs[0]] = cssStrs[1];
    }
  }


  gotoAppSotre() {
    this.appGlobalService.openUrl("", this.appStoreUrl);
  }

}
